package com.evolution.warlock.entity;

import java.util.HashSet;
import java.util.Set;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.Similarity;
import org.hibernate.search.annotations.Store;
import org.hibernate.validator.constraints.Length;
import org.wltea.analyzer.lucene.IKSimilarity;

@Indexed
@Similarity(impl = IKSimilarity.class)
@Entity
@Table(name = "ev_criminal_number")
@SequenceGenerator(name = "sequenceGenerator", sequenceName = "ev_criminal_number_squence")
public class CriminalMember extends BaseEntity {

	private static final long serialVersionUID = -8944473333755579880L;

	/** 身份证号 */
	private String idCardNum;

	/** 性别 */
	private Integer gender;

	/** 姓名 */
	private String name;

	/** 绰号别名曾用名 */
	private String alias;

	/** 年龄 */
	private Integer age;

	/** 婚姻情况 */
	private Integer marriage;

	/** 职业 */
	private Integer profession;
	
	/** 职业其他 */
	private String professionAnother;

	/** 父母是否离异 */
	private Integer parentDivorce;

	/** 宗教 */
	private Religion religion;

	/** 民族 */
	private Ethnic ethnic;

	/** 文化程度 */
	private Integer educationLevel;

	/** 是否 为农民工子弟 */
	private Integer sonOfFarmer;

	/** 是否有犯罪前科 */
	private Integer criminalBefore;
	
	/** 收入主要来源 */
	private Integer mainIncome;
	
	/** 收入主要来源其他 */
	private String mainIncomeAnother;

	/** 有无联系方式 */
	private Integer contectNumOrNot;
	
	/** 手机号 */
	private String phoneNumber;
	
	/** 座机号 */
	private String telephoneNumber;
	
	/** 是否是黑户 */
	private Integer noRigisterCensus;

	/** 户籍地区 */
	private Integer householdArea;

	/** 户籍地址 */
	private String householdAddress;
	
	/** 户籍所属派出所名称 */
	private Integer householdPoliceStationName;

	/** 当前所住地区 */
	private Integer currentArea;

	/** 当前住址 */
	private String currentAddress;

	/** 现住址所属派出所名称 */
	private Integer currentPoliceStationName;
	
	/** 亲属姓名 */
	private String relativeName;
	
	/** 亲属居住地区 */
	private Integer relativeArea;
	
	/** 亲属居住地址 */
	private String relativeAddress;
	
	/*** 亲属居住地所属派出所 */
	private Integer relativeAddressPoliceName;

	/** 犯罪基础表 */
	private Set<CriminalBase> criminalBase = new HashSet<CriminalBase>();

	@NotNull
	@Field(store = Store.YES, index = Index.UN_TOKENIZED)
	@Length(max = 40)
	@Column(nullable = false, unique = true, length = 40)	
	public String getIdCardNum() {
		return idCardNum;
	}

	public void setIdCardNum(String idCardNum) {
		this.idCardNum = idCardNum;
	}

	@NotNull
	@Length(max = 2)
	@Column(nullable = false, length = 2)
	public Integer getGender() {
		return gender;
	}

	public void setGender(Integer gender) {
		this.gender = gender;
	}

	@NotNull
	@Length(max = 20)
	@Column(nullable = false, length = 20)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	
	@Length(max = 50)
	public String getAlias() {
		return alias;
	}
	
	public void setAlias(String alias) {
		this.alias = alias;
	}

	
	@NotNull
	@Length(max = 3)
	@Column(nullable = false, length = 3)
	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	@NotNull
	@Length(max = 2)
	@Column(nullable = false, length = 2)
	public Integer getMarriage() {
		return marriage;
	}

	public void setMarriage(Integer marriage) {
		this.marriage = marriage;
	}

	@NotNull
	@Length(max = 2)
	@Column(nullable = false,  length = 2)
	public Integer getProfession() {
		return profession;
	}

	public void setProfession(Integer profession) {
		this.profession = profession;
	}
	
	
	@Length(max = 20)
	public String getProfessionAnother() {
		return professionAnother;
	}

	public void setProfessionAnother(String professionAnother) {
		this.professionAnother = professionAnother;
	}	

	
	@NotNull
	@Length(max = 2)
	@Column(nullable = false,  length = 2)
	public Integer getParentDivorce() {
		return parentDivorce;
	}

	public void setParentDivorce(Integer parentDivorce) {
		this.parentDivorce = parentDivorce;
	}

	
	@ManyToOne(fetch = FetchType.LAZY)
	public Religion getReligion() {
		return religion;
	}

	public void setReligion(Religion religion) {
		this.religion = religion;
	}

	
	@ManyToOne(fetch = FetchType.LAZY)
	public Ethnic getEthnic() {
		return ethnic;
	}

	public void setEthnic(Ethnic ethnic) {
		this.ethnic = ethnic;
	}

	@NotNull
	@Length(max = 2)
	@Column(nullable = false,  length = 2)
	public Integer getEducationLevel() {
		return educationLevel;
	}

	public void setEducationLevel(Integer educationLevel) {
		this.educationLevel = educationLevel;
	}

	@NotNull
	@Length(max = 2)
	@Column(nullable = false,  length = 2)
	public Integer getSonOfFarmer() {
		return sonOfFarmer;
	}

	public void setSonOfFarmer(Integer sonOfFarmer) {
		this.sonOfFarmer = sonOfFarmer;
	}

	
	@NotNull
	@Length(max = 2)
	@Column(nullable = false,  length = 2)
	public Integer getCriminalBefore() {
		return criminalBefore;
	}

	public void setCriminalBefore(Integer criminalBefore) {
		this.criminalBefore = criminalBefore;
	}

	@Length(max = 11)
	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	@Length(max = 15)
	public String getTelephoneNumber() {
		return telephoneNumber;
	}

	public void setTelephoneNumber(String telephoneNumber) {
		this.telephoneNumber = telephoneNumber;
	}

	
	@NotNull
	@Length(max = 2)
	@Column(nullable = false,  length = 2)	
	public Integer getMainIncome() {
		return mainIncome;
	}

	public void setMainIncome(Integer mainIncome) {
		this.mainIncome = mainIncome;
	}

	
	@Length(max = 50)
	public String getMainIncomeAnother() {
		return mainIncomeAnother;
	}

	public void setMainIncomeAnother(String mainIncomeAnother) {
		this.mainIncomeAnother = mainIncomeAnother;
	}

	
	@NotNull
	@Length(max = 2)
	@Column(nullable = false,  length = 2)
	public Integer getNoRigisterCensus() {
		return noRigisterCensus;
	}

	public void setNoRigisterCensus(Integer noRigisterCensus) {
		this.noRigisterCensus = noRigisterCensus;
	}

	@NotNull
	@Length(max = 10)
	@Column(nullable = false,  length = 2)
	public Integer getHouseholdArea() {
		return householdArea;
	}

	public void setHouseholdArea(Integer householdArea) {
		this.householdArea = householdArea;
	}

	@NotNull
	@Length(max = 200)
	@Column(nullable = false, length = 200)
	public String getHouseholdAddress() {
		return householdAddress;
	}

	public void setHouseholdAddress(String householdAddress) {
		this.householdAddress = householdAddress;
	}

	@NotNull
	@Length(max = 2)
	@Column(nullable = false, length = 2)
	public Integer getHouseholdPoliceStationName() {
		return householdPoliceStationName;
	}

	public void setHouseholdPoliceStationName(Integer householdPoliceStationName) {
		this.householdPoliceStationName = householdPoliceStationName;
	}

	
	@NotNull
	@Length(max = 10)
	@Column(nullable = false,  length = 2)
	public Integer getCurrentArea() {
		return currentArea;
	}

	public void setCurrentArea(Integer currentArea) {
		this.currentArea = currentArea;
	}

	
	@NotNull
	@Length(max = 200)
	@Column(nullable = false, length = 200)
	public String getCurrentAddress() {
		return currentAddress;
	}

	public void setCurrentAddress(String currentAddress) {
		this.currentAddress = currentAddress;
	}

	@NotNull
	@Length(max = 2)
	@Column(nullable = false, length = 2)
	public Integer getCurrentPoliceStationName() {
		return currentPoliceStationName;
	}

	public void setCurrentPoliceStationName(Integer currentPoliceStationName) {
		this.currentPoliceStationName = currentPoliceStationName;
	}

	@Length(max = 10)
	public String getRelativeName() {
		return relativeName;
	}

	public void setRelativeName(String relativeName) {
		this.relativeName = relativeName;
	}

	
	@NotNull
	@Length(max = 10)
	@Column(nullable = false,  length = 2)
	public Integer getRelativeArea() {
		return relativeArea;
	}

	public void setRelativeArea(Integer relativeArea) {
		this.relativeArea = relativeArea;
	}

	@Length(max = 100)
	public String getRelativeAddress() {
		return relativeAddress;
	}

	public void setRelativeAddress(String relativeAddress) {
		this.relativeAddress = relativeAddress;
	}

	
	@OneToMany(mappedBy = "criminalNumber", fetch = FetchType.LAZY)
	public Set<CriminalBase> getCriminalBase() {
		return criminalBase;
	}

	public void setCriminalBase(Set<CriminalBase> criminalBase) {
		this.criminalBase = criminalBase;
	}

	@Length(max = 2)
	public Integer getContectNumOrNot() {
		return contectNumOrNot;
	}

	public void setContectNumOrNot(Integer contectNumOrNot) {
		this.contectNumOrNot = contectNumOrNot;
	}


	@NotNull
	@Length(max = 2)
	@Column(nullable = false, length = 2)
	public Integer getRelativeAddressPoliceName() {
		return relativeAddressPoliceName;
	}

	public void setRelativeAddressPoliceName(Integer relativeAddressPoliceName) {
		this.relativeAddressPoliceName = relativeAddressPoliceName;
	}
	
	
	
}
